<?php
	abstract class Elt
	{
		protected $ID_Element;
		protected $Debut;
		protected $Description;
		protected $Fin;
		protected $Piece;
		protected $ID_ActionElement;
		public function __construct($ID_Element, $Debut, $Fin, $ID_ActionElement)
		{
			$pdo = SPDO::pdo();
			$requete = $pdo->query('SELECT * FROM Element, Piece WHERE Piece.ID_Piece = Element.ID_Piece AND ID_Element = '.$ID_Element);
			$resultat = $requete->fetchAll();
			if(count($resultat)>0)
			{
				$this->ID_Element = $ID_Element;
				$this->Debut = $Debut;
				$this->Fin = $Fin;
				$this->Description = $resultat[0]['Description'];
				$this->Piece = $resultat[0]['Nom_Piece'];
				$this->ID_ActionElement = $ID_ActionElement;
			}
			else
			{
				$this->Description = null;
			}
		}
		public abstract function __get($name);
		public abstract function afficher($c);
	}
?>
